package com.jin.ks.provider;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper {

    // 数据库名
    private static final String DATABASE_NAME = "user.db";

    // 表名
    public static final String USER_TABLE_NAME = "UserInfo";
    //public static final String JOB_TABLE_NAME = "job";

    private static final int DATABASE_VERSION = 1;
    //数据库版本号

    public DBHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {

        // 创建表格:用户表
        db.execSQL("CREATE TABLE IF NOT EXISTS " + USER_TABLE_NAME + "(_id INTEGER PRIMARY KEY AUTOINCREMENT," + "mName nchar(20)," +
                "mKuaiId nchar(20),"+
                "mFan nchar(10),"+
                "mFollow nchar(10),"+
                "mMoment nchar(10),"+
                "mLike nchar(10),"+
                "mPhoto nchar(10),"+
                "mText nchar(20),"+
                "mBirthday nchar(10),"+
                "mTodayFollow nchar(10),"+
                "mTime nchar(10))");

        //db.execSQL("CREATE TABLE IF NOT EXISTS " + JOB_TABLE_NAME + "(_id INTEGER PRIMARY KEY AUTOINCREMENT," + " job TEXT)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)   {

    }
}